<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>招募裁判</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
        content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="../css/font.css">
    <link rel="stylesheet" href="../css/iconfont.css">
    <link rel="stylesheet" href="../lib/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="../css/xadmin.css">
    <script src="../lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script type="text/javascript" src="../js/xadmin.js"></script>
    <script src="../js/base.js"></script>
    <script src="../js/vue.min.js"></script>
    <style>
        tr td,
        tr th {
            text-align: center !important;
            border: none !important;
        }

        .layui-laydate-content tr td {
            border-bottom: none !important;
            border-top: none !important;
        }

        tr td {
            border-bottom: 1px solid #eee !important;
            border-top: 1px solid #eee !important;
        }

        .shaixuan .layui-col-md12 .layui-inline {
            margin: 0;
        }

        .shaixuan .layui-col-md12 .layui-inline.layui-col-md3 .layui-form-label {
            width: 30%;
            padding-left: 0;
        }

        .shaixuan .layui-col-md12 .layui-inline.layui-col-md3 .layui-input-inline {
            width: 53%;
        }

        .rotate {
            transform-origin: center center;
            transform: rotate(180deg);
            -webkit-transform: rotate(180deg);
            -moz-transform: rotate(180deg);
            -ms-transform: rotate(180deg);
            -o-transform: rotate(180deg);
            transition: transform 0.2s;
            -moz-transition: -moz-transform 0.2s;
            -moz-transition: -moz-transform 0.2s;
            -o-transition: -o-transform 0.2s;
            -ms-transition: -ms-transform 0.2s;
        }

        .rotate1 {
            transform-origin: center center;
            transform: rotate(0deg);
            -webkit-transform: rotate(0deg);
            -moz-transform: rotate(deg);
            -ms-transform: rotate(0deg);
            -o-transform: rotate(0deg);
            transition: transform 0.2s;
            -moz-transition: -moz-transform 0.2s;
            -moz-transition: -moz-transform 0.2s;
            -o-transition: -o-transform 0.2s;
            -ms-transition: -ms-transform 0.2s;
        }

        .send ul li {
            margin-bottom: 10px;
        }
    </style>
</head>

<body>
    <div class="layui-fluid" id="All_List">
        <div class="title">赛事基本信息</div>
        <div class="borders" style="width:95%">
            <ul>
                <li>
                    <h2>赛事名称：</h2>
                    <p>{{name}}</p>
                </li>
                <li>
                    <h2>对战人数：</h2>
                    <p>{{vsPerNum}}</p>
                </li>
                <li>
                    <h2>起止时间：</h2>
                    <p>{{competitionStartTime}} 至 {{competitionEndTime}}</p>
                </li>
                <li>
                    <h2>赛制规则：</h2>
                    <p>{{rules}}</p>
                </li>
                <li>
                    <h2>主办地：</h2>
                    <p>{{province}}</p>
                </li>
            </ul>
        </div>
        <div class="title"
            style="background: #ddd;border:1px solid #ccc;line-height: 34px;text-align:left;padding:0 20px;">
            发送裁判报名通知
            <div style="float: right;">该通知已发送：<span id="allnotice"></span>人，已读：<span id="readnotice"></span>人，未读<span
                    id="noreadnotice"></span>人。
                <button style="position: relative;top: -1px;left: 4px;background: #3DB6FE;
                border: 1px solid #3DB6FE;
                padding:0 5px;
                height: 28px;
                line-height: 26px;
                color: #fff;
                cursor: pointer;" class="search_btn" @click="sendAgain">再次发送通知</button>
            </div>
        </div>

        <div class="send" style="text-align: center;">
            <ul style="display: inline-block;text-align: left;">
                <li>
                    <input type="text" id="recruitRedereeReportingTime">
                    <span>报到时间</span>
                </li>
                <li>
                    <input type="text" id="recruitRedereeStartTime">
                    <span>裁判员招募开始时间</span>
                </li>
                <li>
                    <input type="text" id="recruitRedereeEndTime">
                    <span>裁判员招募结束时间</span>
                </li>
                <li>
                    <input type="text" id="recruitRedereeNum">
                    <span>招募裁判人数</span>
                </li>
                <li>
                    <input type="radio" name="send" value="1">
                    <span>通知平台内所有裁判</span>
                </li>
                <li>
                    <input type="radio" name="send" value="2">
                    <span>通知区域内所有裁判</span>
                    <select name="deptId" id="chooseCity">
                        <option value="">全部</option>
                        <option value="济南市">济南市</option>
                        <option value="青岛市">青岛市</option>
                        <option value="聊城市">聊城市</option>
                        <option value="德州市">德州市</option>
                        <option value="东营市">东营市</option>
                        <option value="淄博市">淄博市</option>
                        <option value="潍坊市">潍坊市</option>
                        <option value="烟台市">烟台市</option>
                        <option value="威海市">威海市</option>
                        <option value="日照市">日照市</option>
                        <option value="临沂市">临沂市</option>
                        <option value="枣庄市">枣庄市</option>
                        <option value="济宁市">济宁市</option>
                        <option value="泰安市">泰安市</option>
                        <option value="滨州市">滨州市</option>
                        <option value="菏泽市">菏泽市</option>
                    </select>
                    <button style="position: relative;top: -1px;left: 4px;" class="search_btn"
                        @click='SearchCity'>查询</button>
                </li>
                <li>
                    <input type="radio" name="send" value="3">
                    <span>通知指定裁判员</span>
                    <div class="searching" style="width: auto;">
                        <input type="text" class="user_name">
                        <button class="search_btn" @click='Search'>查询</button>
                        <button class="search_btn" @click='importRef'>导入裁判</button>
                        <div class="Referee">
                            <ul>
                                <li v-for="(item,index) in items" :data-id='item.id'>
                                    <div class="img">
                                        <img :src="item.headPhoto" alt="">
                                    </div>
                                    <p>{{item.name}}</p>
                                    <div class="add" @click='add_arr(item.id,index)'>添加</div>
                                </li>
                            </ul>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
        <div class="clear"></div>
        <div class="layui-card-body layui-table-body layui-table-main biaoge" style="display: none;">
            <!-- 表格部分开始 -->
            <table id="application_table" lay-filter="test" lay-data="{id: 'testReload'}"></table>
            <script type="text/html" id="barDemo">
                <!-- <a lay-event="look" class="btn_a layui-btn layui-btn-xs">查看</a> -->
            <!-- <a lay-event="watch" class="btn_a layui-btn layui-btn-xs">确认招募</a> -->
            <a lay-event="del" class="btn_a layui-btn layui-btn-danger layui-btn-xs">删除</a>
            </script>
            <!-- 表格结束 -->
        </div>
        <div class="send_btn" @click='send_msg'>通知指定裁判员</div>
    </div>
    <script>
        var dataId;
        var arry = [];
        var alljudge = [];
        var str = [];
        var table1

        function child(d) {
            dataId = d
            layui.use(['table', 'laydate'], function () {

                $(document).on('click', function () {
                    $('.send ul li .searching .Referee').on('click', function (event) {
                        event.stopPropagation();
                        return false
                    });
                    $('.send ul li .searching .Referee').fadeOut()
                });


                var table = layui.table;
                table1 = layui.table
                var form = layui.form;
                var laydate = layui.laydate;
                var index = layer.load(1); //添加laoding,0-2两种方式
                layer.close(index)

                setTimeout(function () {
                    laydate.render({ // 初始化时间选择器
                        elem: '#year',
                        type: 'year'
                    });
                    laydate.render({ // 初始化时间选择器
                        elem: '#birthDay',
                    });
                    laydate.render({ // 初始化时间选择器
                        elem: '#recruitRedereeStartTime',
                        type: 'datetime'
                    });
                    laydate.render({ // 初始化时间选择器
                        elem: '#recruitRedereeEndTime',
                        type: 'datetime'
                    });
                    laydate.render({ // 初始化时间选择器
                        elem: '#recruitRedereeReportingTime',
                        type: 'datetime'
                    });
                }, 100)
                // var type;
                $(document).ready(function () {
                    $('input[type=radio][name=send]').change(function () {
                        arry = [];
                        str = [];
                        // type = this.value
                        if (this.value == '1') {
                            $('.biaoge').css('display', 'none')
                        } else if (this.value == '2') {
                            $('.biaoge').css('display', 'block')
                        } else if (this.value == '3') {
                            $('.biaoge').css('display', 'block')
                        }
                    });
                });

                var app = new Vue({
                    el: "#All_List",
                    data: {
                        items: [],
                        name: '',
                        vsPerNum: '',
                        competitionStartTime: '',
                        competitionEndTime: '',
                        rules: '',
                        province: '',
                        city: '',
                        organizers: '',
                    },
                    methods: {
                        index() {
                            var that = this
                            $.ajax({
                                url: findNewcompetitionById,
                                type: 'get',
                                data: {
                                    id: dataId
                                },
                                dataType: 'json',
                                success: function (data) {
                                    console.log(data)
                                    if (data.msg == 0) {
                                        that.name = data.newcompetition.name
                                        that.vsPerNum = data.newcompetition.vsPerNum
                                        that.competitionStartTime = data.newcompetition
                                            .competitionStartTime
                                        that.competitionEndTime = data.newcompetition
                                            .competitionEndTime
                                        that.rules = data.newcompetition.rules
                                        that.province = data.newcompetition.province
                                        that.city = data.newcompetition.city
                                        that.organizers = data.newcompetition.organizers
                                        $("#recruitRedereeReportingTime").val(data
                                            .newcompetition.recruitRedereeReportingTime)
                                        $("#recruitRedereeStartTime").val(data
                                            .newcompetition.recruitRedereeStartTime)
                                        $("#recruitRedereeEndTime").val(data.newcompetition
                                            .recruitRedereeEndTime)
                                        $("#recruitRedereeNum").val(data.newcompetition
                                            .recruitRedereeNum)
                                    } else if (data.msg != 0) {
                                        layer.alert(data.msg, {
                                            title: '提示'
                                        })
                                    }
                                },
                                error: function (data) {
                                    console.log(data)
                                    layer.alert(data.msg, {
                                        title: '提示'
                                    })
                                }
                            });
                        },
                        sendAgain() {
                            $.ajax({
                                url: againSendMessage,
                                type: 'get',
                                data: {
                                    matchId: dataId,
                                },
                                dataType: 'json',
                                success: function (data) {
                                    if (data.msg == "0") {
                                        layer.msg("发送成功")
                                    } else {
                                        layer.msg(data.msg)
                                    }


                                },
                                error: function (data) {
                                    console.log(data)
                                    layer.alert(data.msg, {
                                        title: '提示'
                                    })
                                }
                            });
                        },
                        Search() {
                            var that = this
                            var user_name = $('.user_name').val()
                            if (user_name == '') {
                                layer.alert("请输入裁判员名字进行查询", {
                                    title: '提示'
                                })
                                return false
                            }
                            $.ajax({
                                url: findRefereeByName,
                                type: 'get',
                                data: {
                                    name: user_name
                                },
                                dataType: 'json',
                                success: function (data) {
                                    if (data.msg == 0) {
                                        alljudge = data.userList
                                        if (data.userList.length == 0) {
                                            layer.alert("查询不到此裁判", {
                                                title: '提示'
                                            })
                                        } else if (data.userList.length > 0) {
                                            $('.send ul li .searching .Referee').fadeIn()
                                            that.items = data.userList
                                        }
                                    } else if (data.msg != 0) {
                                        layer.alert(data.msg, {
                                            title: '提示'
                                        })
                                    }
                                },
                                error: function (data) {
                                    console.log(data)
                                    layer.alert(data.msg, {
                                        title: '提示'
                                    })
                                }
                            });
                        },
                        SearchCity() {
                            var that = this
                            var user_name = $('#chooseCity').val()

                            if (user_name == '') {
                                layer.alert("请选择要查询的城市", {
                                    title: '提示'
                                })
                                return false
                            }
                            $.ajax({
                                url: findRefereeByCity,
                                type: 'get',
                                data: {
                                    city: user_name
                                },
                                dataType: 'json',
                                success: function (data) {
                                    table.render({
                                        elem: '#application_table', //指定原始表格元素选择器（推荐id选择器）
                                        // height: 600,
                                        toolbar: true,
                                        defaultToolbar: ['exports', {
                                            title: '提示' //标题
                                                ,
                                            layEvent: 'LAYTABLE_TIPS' //事件名，用于 toolbar 事件中使用
                                                ,
                                            icon: 'layui-icon-tips' //图标类名
                                        }],
                                        data: data.data,
                                        width: "100%",
                                        // 附加参数，post token
                                        // where: { 'token': token },
                                        loading: false,
                                        method: 'get',
                                        // url: getJudgeList, //数据接口
                                        page: true, //开启分页
                                        // toolbar: 'default', //开启工具栏，此处显示默认图标
                                        limit: 10,
                                        limits: [10, 20, 30, 50, 100, 500, 1000,
                                            5000, 10000
                                        ],
                                        cols: [
                                            [ //表头
                                                {
                                                    type: 'checkbox',
                                                    fixed: 'left'
                                                },
                                                {
                                                    field: 'id',
                                                    title: '用户ID',
                                                    width: 200
                                                },
                                                {
                                                    field: 'name',
                                                    title: '姓名',
                                                    width: 200
                                                },
                                                {
                                                    field: 'sex',
                                                    title: '性别',
                                                    width: 200
                                                },
                                                {
                                                    field: 'bloodType',
                                                    title: '血型',
                                                    width: 200
                                                },
                                                {
                                                    field: 'nation',
                                                    title: '民族',
                                                    width: 200
                                                },
                                                {
                                                    field: 'year',
                                                    title: '年份',
                                                    width: 200
                                                },
                                                {
                                                    field: 'city',
                                                    title: '市级',
                                                    width: 200
                                                },
                                                {
                                                    field: 'headPhoto',
                                                    title: '相关资质照片',
                                                    width: 200,
                                                    templet: function (d) {
                                                        if (d.headPhoto ==
                                                            null) {
                                                            return "-"
                                                        } else {
                                                            return "<div onclick='show_img(this)' ><img style='width: 32px;height: 32px;' src='" +
                                                                d
                                                                .headPhoto +
                                                                "'></div>'"
                                                        }
                                                    }
                                                },
                                                {
                                                    field: 'addTime',
                                                    title: '创建时间',
                                                    width: 200,
                                                    templet: function (d) {
                                                        if (d.addTime ==
                                                            null) {
                                                            return "-"
                                                        } else {
                                                            return d.addTime
                                                        }
                                                    }
                                                },
                                                {
                                                    fixed: 'right',
                                                    title: "操作",
                                                    width: 200,
                                                    align: 'center',
                                                    toolbar: '#barDemo'
                                                }
                                            ]
                                        ],
                                        id: 'testReload',
                                        done: function (res, curr, count) {
                                            table.on('checkbox(test)',
                                                function (res) {
                                                    var checkStatus = table
                                                        .checkStatus(
                                                            'testReload')
                                                    // console.log(checkStatus.data)
                                                    str = []
                                                    for (var i = 0; i <
                                                        checkStatus.data
                                                        .length; i++) {
                                                        str.push(
                                                            checkStatus
                                                            .data[i]
                                                            .id)
                                                    }
                                                    console.log(
                                                        str)
                                                    // console.log(str.substring(0,str.length-1))
                                                });

                                        }
                                    });

                                },
                                error: function (data) {
                                    console.log(data)
                                    layer.alert(data.msg, {
                                        title: '提示'
                                    })
                                }
                            });
                        },
                        importRef() {
                            xadmin.open('导入', 'import_referee.html', 600, 400)
                            arry = []
                        },
                        add_arr(id, index) {
                            var flag = []
                            var thisjudge = alljudge[index]
                            for (var i = 0; i < arry.length; i++) {
                                if (thisjudge.id == arry[i].id) {
                                    flag.push("true")
                                }
                            }
                            if (flag.indexOf("true") == -1) {
                                arry.push(thisjudge)
                            } else {
                                layer.msg('请勿重复添加裁判员');
                            }

                            var that = this
                            $('.send ul li .searching .Referee').fadeOut()
                            //第一个实例   
                            that.tableRender()
                        },
                        tableRender() {
                            table.render({
                                elem: '#application_table', //指定原始表格元素选择器（推荐id选择器）
                                // height: 600,
                                toolbar: true,
                                defaultToolbar: ['exports', {
                                    title: '提示' //标题
                                        ,
                                    layEvent: 'LAYTABLE_TIPS' //事件名，用于 toolbar 事件中使用
                                        ,
                                    icon: 'layui-icon-tips' //图标类名
                                }],
                                data: arry,
                                width: "100%",
                                // 附加参数，post token
                                // where: { 'token': token },
                                loading: false,
                                method: 'get',
                                // url: getJudgeList, //数据接口
                                page: true, //开启分页
                                // toolbar: 'default', //开启工具栏，此处显示默认图标
                                limit: 10,
                                limits: [10, 20, 30, 50, 100, 500, 1000, 5000, 10000],
                                cols: [
                                    [ //表头
                                        {
                                            type: 'checkbox',
                                            fixed: 'left'
                                        },
                                        {
                                            field: 'id',
                                            title: '用户ID',
                                            width: 200
                                        },
                                        {
                                            field: 'name',
                                            title: '姓名',
                                            width: 200
                                        },
                                        {
                                            field: 'sex',
                                            title: '性别',
                                            width: 200
                                        },
                                        {
                                            field: 'bloodType',
                                            title: '血型',
                                            width: 200
                                        },
                                        {
                                            field: 'nation',
                                            title: '民族',
                                            width: 200
                                        },
                                        {
                                            field: 'year',
                                            title: '年份',
                                            width: 200
                                        },
                                        {
                                            field: 'city',
                                            title: '市级',
                                            width: 200
                                        },
                                        {
                                            field: 'headPhoto',
                                            title: '相关资质照片',
                                            width: 200,
                                            templet: function (d) {
                                                if (d.headPhoto ==
                                                    null) {
                                                    return "-"
                                                } else {
                                                    return "<div onclick='show_img(this)' ><img style='width: 32px;height: 32px;' src='" +
                                                        d
                                                        .headPhoto +
                                                        "'></div>'"
                                                }
                                            }
                                        },
                                        {
                                            field: 'addTime',
                                            title: '创建时间',
                                            width: 200,
                                            templet: function (d) {
                                                if (d.addTime ==
                                                    null) {
                                                    return "-"
                                                } else {
                                                    return d.addTime
                                                }
                                            }
                                        },
                                        {
                                            fixed: 'right',
                                            title: "操作",
                                            width: 200,
                                            align: 'center',
                                            toolbar: '#barDemo'
                                        }
                                    ]
                                ],
                                id: 'testReload',
                                done: function (res, curr, count) {
                                    table.on('checkbox(test)', function (res) {
                                        var checkStatus = table.checkStatus(
                                            'testReload')
                                        // console.log(checkStatus.data)
                                        str = []
                                        for (var i = 0; i <
                                            checkStatus.data
                                            .length; i++) {
                                            str.push(
                                                checkStatus
                                                .data[i]
                                                .id)
                                        }
                                        // console.log(str.substring(0,str.length-1))
                                    });

                                }
                            });
                        },
                        send_msg() {
                            var that = this
                            var type = $('input[type=radio][name=send]:checked').val()
                            var recruitRedereeReportingTime = $("#recruitRedereeReportingTime").val()
                            var recruitRedereeStartTime = $("#recruitRedereeStartTime").val()
                            var recruitRedereeEndTime = $("#recruitRedereeEndTime").val()
                            var recruitRedereeNum = $("#recruitRedereeNum").val()
                            if (recruitRedereeReportingTime == "") {
                                layer.msg('请选择报到时间')
                                return false
                            } else if (recruitRedereeStartTime == "") {
                                layer.msg('请选择裁判员招募开始时间')
                                return false
                            } else if (recruitRedereeEndTime == "") {
                                layer.msg('请选择裁判员招募结束时间')
                                return false
                            } else if (recruitRedereeNum == "") {
                                layer.msg('请选择招募裁判人数')
                                return false
                            } else if (recruitRedereeStartTime > recruitRedereeEndTime) {
                                layer.msg('裁判员招募开始时间不能大于请选择裁判员招募结束时间')
                                return false
                            }
                            if (type == 2 || type == 3) {
                                if (str.length == 0) {
                                    layer.msg('请选择裁判员')
                                    return false
                                }
                            }
                            $.ajax({
                                url: updateNewCompetitionByReferee,
                                type: 'get',
                                data: {
                                    recruitRedereeReportingTime: recruitRedereeReportingTime,
                                    recruitRedereeStartTime: recruitRedereeStartTime,
                                    recruitRedereeEndTime: recruitRedereeEndTime,
                                    recruitRedereeNum: recruitRedereeNum,
                                    id: dataId
                                },
                                dataType: 'json',
                                success: function (data) {
                                    if (data.msg == 0) {
                                        $.ajax({
                                            url: addnewcompetitionMessage,
                                            type: 'get',
                                            data: {
                                                type: type,
                                                userId: JSON.stringify(str),
                                                newcompetitionId: dataId,
                                            },
                                            dataType: 'json',
                                            success: function (data) {
                                                console.log(data)
                                                if (data.msg == 0) {
                                                    layer.alert('发送成功', {
                                                        title: '提示'
                                                    })
                                                    setTimeout(function () {
                                                        window.location
                                                            .reload();
                                                    }, 1000)
                                                } else if (data.msg != 0) {
                                                    layer.alert(data.msg, {
                                                        title: '提示'
                                                    })
                                                }
                                            },
                                            error: function (data) {
                                                console.log(data)
                                                layer.alert(data.msg, {
                                                    title: '提示'
                                                })
                                            }
                                        });
                                    } else if (data.msg != 0) {
                                        layer.alert(data.msg, {
                                            title: '提示'
                                        })
                                    }
                                },
                                error: function (data) {
                                    console.log(data)
                                    layer.alert(data.msg, {
                                        title: '提示'
                                    })
                                }
                            });
                        },
                    },
                    created() {
                        this.index()
                        $.ajax({
                            url: getUnread,
                            type: 'get',
                            data: {
                                matchId: dataId,
                            },
                            dataType: 'json',
                            success: function (data) {
                                console.log(data)
                                $("#allnotice").text(data.sumCount)
                                $("#noreadnotice").text(data.unreadCount)
                                $("#readnotice").text(data.readCount)

                            },
                            error: function (data) {
                                console.log(data)
                                layer.alert(data.msg, {
                                    title: '提示'
                                })
                            }
                        });
                    }
                })

                //   table.on('checkbox(test)', function (obj) {
                //       console.log(obj.data)
                // //       var checkStatus = table.checkStatus('idTest')
                // // ,data = checkStatus.data;
                // // layer.alert(JSON.stringify(data));
                //   });
                //监听点击的按钮，获取行信息
                table.on('tool(test)', function (obj) { //注：tool 是工具条事件名，test 是 table 原始容器的属性 lay-filter="对应的值"
                    //获得当前行数据
                    var $ = layui.$
                    var data = obj.data,
                        layEvent = obj.event; //获得 lay-event 对应的值
                    // 查看按钮
                    // if (layEvent === "look") {
                    //    	layer.open({
                    //         content: "Referee_info.html",
                    //         type: 2, //打开的窗口的类型
                    //         area: ["100%", "100%"],
                    //         title: "查看信息",
                    //         // btn: ['确认', '取消'],//开启显示按钮功能
                    //         // btnAlign: 'c',//居中显示按钮
                    //         // shade:true,
                    //         shadeClose: true,
                    //         success: function (layero, index) {

                    //         }
                    //     })
                    // };
                    // 删除按钮
                    if (layEvent === 'del') {
                        console.log(obj.tr.data('index'))
                        layer.confirm('真的删除行么', function (index) {
                            arry.splice(obj.tr.data('index'), 1)
                            obj.del();
                            layer.close(index);
                        });
                    }
                });
            });
        }

        function render() {
            arry[0]['LAY_TABLE_INDEX'] = '0'
            table1.render({
                elem: '#application_table', //指定原始表格元素选择器（推荐id选择器）
                // height: 600,
                toolbar: true,
                defaultToolbar: ['exports', {
                    title: '提示' //标题
                        ,
                    layEvent: 'LAYTABLE_TIPS' //事件名，用于 toolbar 事件中使用
                        ,
                    icon: 'layui-icon-tips' //图标类名
                }],
                data: arry,
                width: "100%",
                // 附加参数，post token
                // where: { 'token': token },
                loading: false,
                method: 'get',
                // url: getJudgeList, //数据接口
                page: true, //开启分页
                // toolbar: 'default', //开启工具栏，此处显示默认图标
                limit: 10,
                limits: [10, 20, 30, 50, 100, 500, 1000, 5000, 10000],
                cols: [
                    [ //表头
                        {
                            type: 'checkbox',
                            fixed: 'left'
                        },
                        {
                            field: 'id',
                            title: '用户ID',
                            width: 200
                        },
                        {
                            field: 'name',
                            title: '姓名',
                            width: 200
                        },
                        {
                            field: 'sex',
                            title: '性别',
                            width: 200
                        },
                        {
                            field: 'bloodType',
                            title: '血型',
                            width: 200
                        },
                        {
                            field: 'nation',
                            title: '民族',
                            width: 200
                        },
                        {
                            field: 'year',
                            title: '年份',
                            width: 200
                        },
                        {
                            field: 'city',
                            title: '市级',
                            width: 200
                        },
                        {
                            field: 'headPhoto',
                            title: '相关资质照片',
                            width: 200,
                            templet: function (d) {
                                if (d.headPhoto ==
                                    null) {
                                    return "-"
                                } else {
                                    return "<div onclick='show_img(this)' ><img style='width: 32px;height: 32px;' src='" +
                                        d
                                        .headPhoto +
                                        "'></div>'"
                                }
                            }
                        },
                        {
                            field: 'addTime',
                            title: '创建时间',
                            width: 200,
                            templet: function (d) {
                                if (d.addTime ==
                                    null) {
                                    return "-"
                                } else {
                                    return d.addTime
                                }
                            }
                        },
                        {
                            fixed: 'right',
                            title: "操作",
                            width: 200,
                            align: 'center',
                            toolbar: '#barDemo'
                        }
                    ]
                ],
                id: 'testReload',
                done: function (res, curr, count) {
                    table1.on('checkbox(test)', function (res) {
                        var checkStatus = table.checkStatus(
                            'testReload')
                        // console.log(checkStatus.data)
                        str = []
                        for (var i = 0; i <
                            checkStatus.data
                            .length; i++) {
                            str.push(
                                checkStatus
                                .data[i]
                                .id)
                        }
                        // console.log(str.substring(0,str.length-1))
                    });

                }
            });
        }

        function show_img(t) { //放大图片
            var t = $(t).find("img");
            //页面层
            layer.open({
                type: 1,
                skin: 'layui-layer-rim', //加上边框
                area: ['300px', '343px'], //宽高
                shadeClose: true, //开启遮罩关闭
                end: function (index, layero) {
                    return false;
                },
                content: '<div style="text-align:center;width:100%;height: 100%;overflow: hidden"><img src="' +
                    $(t)
                    .attr('src') + '" style="width:100%;height: 100%;display: block;margin: 0 auto;"/></div>'
            });
        }
    </script>
</body>

</html>